class Myarray<T>{
    Object[] array = new Object[10];

    public void set(int pos,T val){
        this.array[pos] = val;
    }
    public T get(int pos) {
        return (T)this.array[pos];
    }
}
public class demo3 {
    public static void main(String[] args) {
        Myarray<String> myArray = new Myarray<>();
        myArray.set(0,"sadfklsajdfs");
        myArray.set(1,"qwe");
        String ret = myArray.get(0);
        String ret1 = myArray.get(1);
        System.out.println(ret);
        System.out.println(ret1);

        Myarray<Integer> myarray = new Myarray<>();
        myarray.set(0,3);
        Integer ret2 = myarray.get(0);
        System.out.println(ret2);

        //T[] ts = new T[5];//是不对的

        //Myarray list = new Myarray();


    }
}
